package com.haoyun.mirage.auth;

import com.haoyun.common.cache.anno.EnableMethodCache;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;


/**
 * @see org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter
 * @see org.springframework.security.oauth2.provider.client.ClientCredentialsTokenEndpointFilter
 * @see org.springframework.security.oauth2.provider.token.DefaultTokenServices
 * @see org.springframework.security.authentication.dao.DaoAuthenticationProvider
 * @see org.springframework.security.web.authentication.www.BasicAuthenticationFilter
 * @see org.springframework.security.oauth2.provider.authentication.BearerTokenExtractor #header里面的Authorization是存放的clientId和clientSecret经过编码的字符串
 */
@EnableFeignClients
@EnableResourceServer
@EnableDiscoveryClient
@EnableCircuitBreaker
@EnableMethodCache
@EnableGlobalMethodSecurity(prePostEnabled = true)
@SpringBootApplication(scanBasePackages = "com.haoyun")
public class AuthServiceApplication {

    public static void main(String[] args) {
        SpringApplication.run(AuthServiceApplication.class, args);
    }

}
